<?php
class p1_event_comment extends BaseModel implements Retrievable {

	var $event;
	var $name;
	var $message;
	
    public function p1_event_comment($values) {
        parent::__construct($values);
    }

    public function validate() {
        $errors = Array();
        if($this->name == '') {
        	$errors[] = 'Please enter your name.';
        }
        if($this->message == '') {
        	$errors[] = 'Please enter your message.';
        }
		return (count($errors) === 0 ? true : $errors);
    }

    public static function get($id, $primaryKey='id') {
        return parent::get($id, __CLASS__, $primaryKey);
    }
    
    public static function getAll($searchArray=Array(), $sortArray=Array()) {
        return parent::getAll($searchArray, $sortArray, __CLASS__);
    }
    
}
?>